package com.proxy.model.dynamic;

import com.proxy.model.Source;
import com.proxy.model.Sourceable;

import java.lang.reflect.Proxy;

public class DynamicProxyTest {
    public static void main(String[] args) {
        Sourceable source = new Source();
        Sourceable sourceable = (Sourceable) Proxy.newProxyInstance(Sourceable.class.getClassLoader(), new
                Class[]{Sourceable.class}, new DynamicProxyHandler(source));
        sourceable.method();
    }


}
